package com.android.hq.ganktoutiao.ui.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.hq.ganktoutiao.R;
import com.android.hq.ganktoutiao.ui.view.RatioImageView;
import com.kcode.autoscrollviewpager.view.AutoScrollViewPager;

/**
 * Created by heqiang on 16-10-9.
 */
public class ViewHolder {
    public static class ContentViewHolder extends RecyclerView.ViewHolder{
        public TextView mTitle;
        public TextView mFrom;
        public TextView mTime;

        public ContentViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_content, parent,false));
            mTitle = (TextView) itemView.findViewById(R.id.content_title);
            mFrom = (TextView) itemView.findViewById(R.id.item_footer_from);
            mTime = (TextView) itemView.findViewById(R.id.item_footer_time);
        }
    }

    public static class FooterHolder extends RecyclerView.ViewHolder{
        //public TextView mTitle;

        public FooterHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_footer, parent,false));
            //mTitle = (TextView) itemView.findViewById(R.id.content_title);
        }
    }

    public static class HeaderViewHolder extends RecyclerView.ViewHolder{
        public TextView mTitle;

        public HeaderViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_title, parent,false));
            mTitle = (TextView) itemView.findViewById(R.id.category_title);
        }
    }

    public static class ImageViewHolder extends RecyclerView.ViewHolder{
        public RatioImageView mImageView;

        public ImageViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_image, parent,false));
            mImageView = (RatioImageView) itemView.findViewById(R.id.image);
            mImageView.setRatio(1.5f);
        }
    }

    public static class SearchViewHolder extends RecyclerView.ViewHolder{
        public TextView mTitle;
        public TextView mFrom;
        public TextView mTime;
        public TextView mType;

        public SearchViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_content, parent,false));
            mTitle = (TextView) itemView.findViewById(R.id.content_title);
            mFrom = (TextView) itemView.findViewById(R.id.item_footer_from);
            mTime = (TextView) itemView.findViewById(R.id.item_footer_time);
            mType = (TextView) itemView.findViewById(R.id.item_footer_type);
            mType.setVisibility(View.VISIBLE);
        }
    }

    public static class HistoryFavViewHolder extends RecyclerView.ViewHolder{
        public TextView mTitle;
        public TextView mFrom;
        public TextView mTime;
        public TextView mType;

        public HistoryFavViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_content, parent,false));
            mTitle = (TextView) itemView.findViewById(R.id.content_title);
            mFrom = (TextView) itemView.findViewById(R.id.item_footer_from);
            mTime = (TextView) itemView.findViewById(R.id.item_footer_time);
            mType = (TextView) itemView.findViewById(R.id.item_footer_type);
            mType.setVisibility(View.VISIBLE);
        }
    }

    public static class NewsViewHolder extends RecyclerView.ViewHolder{
        public TextView mText;
        public TextView mYuDu;
        public ImageView mImg;
        public TextView mTime;

        public NewsViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycle_item_news, parent,false));
            mText = (TextView) itemView.findViewById(R.id.news_text);
            mYuDu = (TextView) itemView.findViewById(R.id.news_yudu);
            mImg = (ImageView) itemView.findViewById(R.id.news_image);
            mTime = (TextView) itemView.findViewById(R.id.news_shijian);

        }
    }

    public static class JingJiViewHolder extends RecyclerView.ViewHolder{
        public TextView jText;
        public TextView jYuDu;
        public ImageView jImg;
        public TextView jTime;

        public JingJiViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_jingji, parent,false));
            jText = (TextView) itemView.findViewById(R.id.jingji_text);
            jYuDu = (TextView) itemView.findViewById(R.id.jingji_yudu);
            jImg = (ImageView) itemView.findViewById(R.id.jingji_image);
            jTime = (TextView) itemView.findViewById(R.id.jingji_shijian);

        }

    }

    public static class ZhiHuiViewHolder extends RecyclerView.ViewHolder{
        public TextView zText;
        public TextView zYuDu;
        public ImageView zImg;
        public TextView zTime;

        public ZhiHuiViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_zhihui, parent,false));
            zText = (TextView) itemView.findViewById(R.id.zhihui_text);
            zYuDu = (TextView) itemView.findViewById(R.id.zhihui_yudu);
            zImg = (ImageView) itemView.findViewById(R.id.zhihui_image);
            zTime = (TextView) itemView.findViewById(R.id.zhihui_shijian);

        }

    }

    public static class TianXiaViewHolder extends RecyclerView.ViewHolder{
        public TextView tText;
        public TextView tYuDu;
        public ImageView tImg;
        public TextView tTime;

        public TianXiaViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_tianxia, parent,false));
            tText = (TextView) itemView.findViewById(R.id.tianxia_text);
            tYuDu = (TextView) itemView.findViewById(R.id.tianxia_yudu);
            tImg = (ImageView) itemView.findViewById(R.id.tianxia_image);
            tTime = (TextView) itemView.findViewById(R.id.tianxia_shijian);

        }

    }

    public static class DaShuJuViewHolder extends RecyclerView.ViewHolder{
        public TextView dText;
        public TextView dYuDu;
        public ImageView dImg;
        public TextView dTime;

        public DaShuJuViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_dashuju, parent,false));
            dText = (TextView) itemView.findViewById(R.id.dashuju_text);
            dYuDu = (TextView) itemView.findViewById(R.id.dashuju_yudu);
            dImg = (ImageView) itemView.findViewById(R.id.dashuju_image);
            dTime = (TextView) itemView.findViewById(R.id.dashuju_shijian);

        }

    }

    public static class ShiTuViewHolder extends RecyclerView.ViewHolder{
        public TextView sText;
        public TextView sYuDu;
        public ImageView sImg;
        public TextView sTime;

        public ShiTuViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_shijie, parent,false));
            sText = (TextView) itemView.findViewById(R.id.shitu_title);
            sYuDu = (TextView) itemView.findViewById(R.id.shitu_yudu);
            sImg = (ImageView) itemView.findViewById(R.id.shitu_img);
            sTime = (TextView) itemView.findViewById(R.id.shitu_shijian);

        }

    }
    public static class YunGuiViewHolder extends RecyclerView.ViewHolder{
        public TextView yText;
        public TextView yYuDu;
        public ImageView yImg;
        public TextView yTime;

        public YunGuiViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_yunguizhou, parent,false));
            yText = (TextView) itemView.findViewById(R.id.yun_text);
            yYuDu = (TextView) itemView.findViewById(R.id.yun_yudu);
            yImg = (ImageView) itemView.findViewById(R.id.yun_image);
            yTime = (TextView) itemView.findViewById(R.id.yun_shijian);

        }

    }

    public static class LvYouViewHolder extends RecyclerView.ViewHolder{
        public TextView yText;
        public TextView yYuDu;
        public ImageView yImg;
        public TextView yTime;

        public LvYouViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_lvyou, parent,false));
            yText = (TextView) itemView.findViewById(R.id.lvyou_text);
            yYuDu = (TextView) itemView.findViewById(R.id.lvyou_yudu);
            yImg = (ImageView) itemView.findViewById(R.id.lvyou_image);
            yTime = (TextView) itemView.findViewById(R.id.lvyou_shijian);

        }

    }

    public static class AnShunViewHolder extends RecyclerView.ViewHolder{
        public TextView yText;
        public TextView yYuDu;
        public ImageView yImg;
        public TextView yTime;

        public AnShunViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_anshun, parent,false));
            yText = (TextView) itemView.findViewById(R.id.anshun_title);
            yYuDu = (TextView) itemView.findViewById(R.id.anshun_yudu);
            yImg = (ImageView) itemView.findViewById(R.id.anshun_img);
            yTime = (TextView) itemView.findViewById(R.id.anshun_shijian);

        }

    }

    public static class SlideViewHolder extends RecyclerView.ViewHolder{

        public AutoScrollViewPager autoScrollViewpager;

        public SlideViewHolder(ViewGroup parent) {
            super(LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item_scroll, parent,false));
            autoScrollViewpager = (AutoScrollViewPager) itemView.findViewById(R.id.item_scroll_view);
        }
    }


}
